using System;
using System.ComponentModel;

namespace ERPStore.Monitor.ViewModels
{
	public class TaskEntryViewModel : ViewModelBase<ERPStore.Tasks.ViewModels.Task>
	{
		public TaskEntryViewModel()
			: base(new ERPStore.Tasks.ViewModels.Task())
		{
		}
		public TaskEntryViewModel(ERPStore.Tasks.ViewModels.Task model)
			: base(model)
		{
		}

		[Bindable(true)]
		public string Id
		{
			get
			{
				return base.Model.Id;
			}
		}

		[Bindable(true)]
		public string Name
		{
			get
			{
				return base.Model.Name;
			}
		}

		[Bindable(true)]
		public DateTime CreationDate
		{
			get
			{
				return base.Model.CreationDate;
			}
		}

		[Bindable(true)]
		public DateTime NextRunningDate
		{
			get
			{
				return base.Model.NextRunningDate;
			}
		}

		[Bindable(true)]
		public ERPStore.Models.ScheduledTaskTimePeriod Period
		{
			get
			{
				return base.Model.Period;
			}
			set
			{
				SetPropertyValue(() => this.Period
					, value
					, () => { Model.Period = value; });
			}
		}

		[Bindable(true)]
		public int Interval
		{
			get
			{
				return base.Model.Interval;
			}
			set
			{
				SetPropertyValue(() => this.Interval
					, value
					, () => { Model.Interval = value; });
			}
		}

		[Bindable(true)]
		public int StartHour
		{
			get
			{
				return base.Model.StartHour;
			}
			set
			{
				SetPropertyValue(() => this.StartHour
					, value
					, () => { Model.StartHour = value; });
			}
		}

		[Bindable(true)]
		public int StartMinute
		{
			get
			{
				return base.Model.StartMinute;
			}
			set
			{
				SetPropertyValue(() => this.StartMinute
					, value
					, () => { Model.StartMinute = value; });
			}
		}

		[Bindable(true)]
		public bool IsRunning
		{
			get
			{
				return base.Model.IsRunning;
			}
			set
			{
				SetPropertyValue(() => this.IsRunning
					, value
					, () => { Model.IsRunning = value; });
			}
		}

		[Bindable(true)]
		public bool IsParallelizable
		{
			get
			{
				return base.Model.IsParallelizable;
			}
			set
			{
				SetPropertyValue(() => this.IsParallelizable
					, value
					, () => { Model.IsParallelizable = value; });
			}
		}

		[Bindable(true)]
		public bool IsEnabled
		{
			get
			{
				return base.Model.Enabled;
			}
			set
			{
				SetPropertyValue(() => this.IsEnabled
					, value
					, () => { Model.Enabled = value; });
			}
		}

		[Bindable(true)]
		public int StartedCount
		{
			get
			{
				return base.Model.StartedCount;
			}
			set
			{
				SetPropertyValue(() => this.StartedCount
					, value
					, () => { Model.StartedCount = value; });
			}
		}

		[Bindable(true)]
		public string MachineName
		{
			get
			{
				return base.Model.MachineName;
			}
		}

		[Bindable(true)]
		public string HostName
		{
			get
			{
				return base.Model.HostName;
			}
		}

		[Bindable(true)]
		public string ApplicationName
		{
			get
			{
				return base.Model.ApplicationName;
			}
		}

		[Bindable(true)]
		public string Context
		{
			get
			{
				return base.Model.Context;
			}
		}

		[Bindable(false)]
		public string ApiUrl { get; set; }

	}
}
